<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录页</title>
    <link rel="stylesheet" type="text/css" href="${bp}/static/css/base.css">
    <script src="${bp}/static/js/jquery-1.11.1.js"></script>
</head>
<body>
<div id="login">
    <h3>欢迎登录</h3>
    <form action="${bp}/user?method=login" method="post">
        <p><input type="text" name="username" class="input"  placeholder="请输入用户名"></p>
        <p><input type="password" name="password" class="input" placeholder="请输入密码"></p>
        <p><input type="text" name="token" style="width: 200px;height: 50px; margin-right: 10px" placeholder="请输入验证码"><img src="${bp}/user?method=getCode" width="90px" height="50px"style="vertical-align: middle" onclick="changeImg()"></p>
        <p><input type="submit" value="立即登录" class="input"><a href="register.jsp">注册账号</a></p>
    </form>
<%--    显示登录错误的信息--%>
    <span style="color: red">${requestScope.msg}</span>
</div>

<script>
    //单击改变验证码
    function changeImg() {
        let sr = $("img").attr("src")+"&date= "+new Date().getTime()
        $("img").attr("src",sr)
    }
</script>


</body>
</html>
